Skip to content

feat: add support for PostgreSQL read replicas in OpenFGA configuration #1043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 13, 2025

Conversation

matthisholleville
Copy link
Contributor

Description

Introduced detailed guidance on configuring OpenFGA with PostgreSQL read replicas to enhance performance and scalability. This update includes instructions for setting up primary and secondary datastores, considerations for synchronous vs. asynchronous replication, and best practices for ensuring data consistency and monitoring replication lag.

References

openfga/openfga#2479

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Introduced detailed guidance on configuring OpenFGA with PostgreSQL read replicas to enhance performance and scalability. This update includes instructions for setting up primary and secondary datastores, considerations for synchronous vs. asynchronous replication, and best practices for ensuring data consistency and monitoring replication lag.

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Copy link
Member

@DanCech DanCech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@matthisholleville
Copy link
Contributor Author

@aaguiarz FYI

@aaguiarz aaguiarz requested a review from Copilot June 13, 2025 13:03
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces detailed documentation for configuring PostgreSQL read replicas in OpenFGA to improve performance and scalability.

  • Adds a new “PostgreSQL Read Replicas Configuration” section with setup instructions
  • Explains synchronous vs. asynchronous replication and consistency controls
  • Provides best practices and example PostgreSQL configuration snippets
Comments suppressed due to low confidence (3)

docs/content/getting-started/setup-openfga/configure-openfga.mdx:91

  • The documentation references HIGHER_CONSISTENCY but the example code uses ConsistencyPreference.HigherConsistency. Please align the naming to avoid confusion by updating the text or example to use the same identifier.
`HIGHER_CONSISTENCY`

docs/content/getting-started/setup-openfga/configure-openfga.mdx:130

  • The replica configuration enables hot_standby but doesn’t explicitly prevent writes on the standby. Consider adding default_transaction_read_only = on to ensure the replica remains read-only.
hot_standby = on

docs/content/getting-started/setup-openfga/configure-openfga.mdx:371

  • The URL path segment data_collection uses an underscore, but the official OpenTelemetry documentation is under data-collection (with a hyphen). This link will likely break; please revert to the correct hyphenated path.
https://opentelemetry.io/docs/concepts/data_collection/

@aaguiarz aaguiarz merged commit 59de63b into openfga:main Jun 13, 2025
7 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants